<template>
    <div>
        <ul class="mui-table-view">
            <li class="mui-table-view-cell mui-media" v-for="item in newsList" :key="item">
                <router-link :to="'/home/newslist/newsinfo/' + 10">
                    <img class="mui-media-object mui-pull-left" src="./img/shuijiao.jpg" />
                    <div class="mui-media-body">
                        CBD
                        <p class="mui-ellipsis">
                            <span>发布时间:{{"2020-10-25 12:00:00" | dateFormat("YYYY-MM-DD")}}</span>
                            <span>点击:10次</span>
                        </p>
                    </div>
                </router-link>
            </li>
        </ul>
    </div>
</template>

<script>
import urlPath from '../../config/api.js';
import {Toast} from 'mint-ui';
export default {
    name: 'newslist',
    data(){
        return {
            newsList: new Array(10),
        };
    },
    mounted(){
        this.getNewsList();
    },
    methods:{
        getNewsList() {
            this.axios.get(urlPath.newsList.getNewsList)
            .then((res) =>{
                // TODO
            })
            .catch((err) =>{
                Toast({
                    message: '加载数据出错',
                    position: 'middle',
                    duration: 3000
                });
            })

        }
    }
};
</script>
<style lang="less" scoped>
.mui-media-body {
    font-size: 16px;
    text-align: left;
    .mui-ellipsis{
        color:#31a4fc;
        display: flex;
        justify-content: space-between;
    }
}
ul{
    padding-bottom: 50px;
}
</style>